<?php

	/* SVN FILE: $Id: tooltip.php 6 2011-01-10 09:24:44Z andreoletti $ */
	
	/**
	 * Project Name : arcadia
	 *
	 * @author $Author: andreoletti $
	 * @version $Revision: 6 $
	 * @lastrevision $Date: 2011-01-10 10:24:44 +0100 (lun, 10 gen 2011) $
	 * @filesource $URL: http://svn.fletchlynd.com/arcadia/trunk/addressbook/tooltip.php $
	 */
	 
	require_once 'include/functions.php';
	require_once 'include/const.inc.php';
	require_once '../include/auth.inc.php';
	require_once '../include/conn.inc.php';
	
	fnGetValueFromGET(array('sField','iView','sTable'));

	$sScript = fnCurrentScript();
	
	$iAccessLvl = fnViewAccessLvl($iView, $aTABLE, $aTABLE_SECURITY_CHECK);
		
	fnTableConst($sTable);
	fnViewConst($sViewItemLink);
			
	$aData = fnCheckView ($iView, $sViewSelectFrom, $sViewSelectGroupBy, 'aData');
		
	if (is_allowed('view', $iAccessLvl) && !empty($aData)) {
	
		$html = "<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
					<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='it' lang='it'>
					<head>
						<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
					</head>
					<body><div class='tooltip'>";

		if ($sField == 'iShowNote' || true) {
			
			$iFieldAccessLvl = fnFieldAccessLvl($iAccessLvl, 0, $sField);
			if (is_allowed('view', $iFieldAccessLvl)) { 
				$html .= "<span class='$sField'>".nl2br($aData['sNote'])."</span>";
			}
			
		} else if ($sField == 'iShowDetails') {
			
			// empty
		
		
		}
		
		$html .= "	<div class='endpage'>&nbsp;</div>";
		
		$html .= "	</div></body>";
		
		echo $html;
	
	} else {
	
		if (!is_allowed('view', $iAccessLvl))
			fnUpdateLog('LOW RIGHTS', $iView, $sViewSelectFrom, 'S');

		if (empty($aData))
			fnUpdateLog('RECORD NOT FOUND', $iView, $sViewSelectFrom, 'E');
		
		echo '';
		
	}
	
?>